import { reactive, ref,onMounted } from 'vue'
import { HttpManager } from "../api/index";
export default async function () {//获取二维码登录所需要的二维码


    async function getQRCode() {
        //获取登录二维码

        let QRCodeKey;
        let QRCodeUrl = ref("");

        await HttpManager.getQRCodeKey().then((res: any) => {
            console.log("res", res);

            QRCodeKey = res.data.unikey;
        });

        await HttpManager.getQRCode({ key: QRCodeKey, qrimg: true }).then(
            (res: any) => {

                QRCodeUrl.value = res.data.qrimg;
            }
        );
        return QRCodeUrl;
    }

    let Res = await getQRCode();



    return Res;



}

